$(function(){
	getUser();
	getPoint();
	InitHelp();
//	$(window).resize(reSize);
//	reSize();
});

/**
 * 初始化用户信息
 */
function getUser(){
	if(!heading.userName || 'null' == heading.userName)
		location.href = '/fw';
	$('#hd_header .heading_user').html(heading.userName);
	
}
/**
 * 初始化用户信息
 */
function getPoint(){
	$.getJSON('/fw/agent/agentReg_findByName.action', {
		'agentName':heading.userName
	},function(data){
		data = data.rows[0]
		$('#hd_header .point').html(data.agentPoint+"点");
	});
}

/**
 * 初始化帮助模块，不同的用户角色对应不同的帮助信息
 */
function InitHelp(){
	if(heading.group == "company")
		$('#heading .panel .item #help').attr("href","/fw/pages/home/help.jsp");
	else
		$('#heading .panel .item #help').attr("href","/fw/pages/help/index.jsp");
}

function reSize() {
	var h = $(window).height();
	$('.content,#manage .menu,#manage .backgroundColor').height(h);
}

function changeHeaderMenu(id) {
	$('#hd_header_menu .item:eq(' + id + ')').addClass('sel');
}
function inCafeList() {
	location.href = "inCafeList.jsp";
}
function recOfConsList() {
	location.href = "recOfConsList.jsp";
}
function changeAgent() {
	location.href = "changeAgent.jsp";
}
